<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:faces="http://java.sun.com/jsf/composite/faces/components"
	xmlns:facesex="http://www.onionframework.org/components/facesex"
	template="/faces/template/form.xhtml">
	
	<ui:param name="action" value="#{code.code}" />

	<ui:define name="formItems">
		<rich:graphValidator>
			<faces:formBox title="代码信息">
				<faces:inputTextItem label="名称" value="#{action.entity.name}"/>
				<faces:inputTextItem label="值" value="#{action.entity.value}"/>
				<faces:selectBooleanCheckboxItem label="是否可用" value="#{action.entity.enabled}"/>
				<faces:inputTextItem label="顺序号" value="#{action.entity.index}"/>
				<faces:selectOneMenuItem label="代码类型" items="#{action.types}" itemLabel="description" value="#{action.entity.type}">
					<facesex:convertEntity for="input"/>
				</faces:selectOneMenuItem>
			</faces:formBox>
		</rich:graphValidator>
	</ui:define>
	<ui:define name="formButtons">
		<faces:button value="保存" action="#{action.save}"
			render="#{faces.tools.tableRender}"
			onsuccess="onion.faces.formPanel.hide();"/>
		<faces:closeFormButton/>
	</ui:define>
</ui:composition>